<?php

namespace app\admin\event;

class AdminLog
{
    public function handle()
    {
        if (request()->isPost()) {
            $module = request()->root();
            $module = trim($module, '/');
            $module = app_map($module, true);
            $controller = request()->controller();

            if($module != 'admin' && strtolower($controller) != 'install'){
                \app\admin\model\AdminLog::record();
            }
//            $databaseConfig = config('database');
//            if(!empty($databaseConfig['connections'][$databaseConfig['default']]['database'])){
////                \app\admin\model\AdminLog::record();
//            }
//            \app\admin\model\AdminLog::record();

        }
    }
}
